package com.tangguo.vshop.domain;

import java.util.Date;
import java.util.List;

import org.springframework.data.mongodb.core.index.IndexDirection;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;

/**
 * 用户
 * @author doonly
 *
 */
public class User extends BaseEntity{
	@DBRef private Mainbody mainbody;
	@Indexed(unique=true, direction= IndexDirection.DESCENDING, dropDups=true)
	private String username;
	private String password;
	private String email;
	private Date lastPasswordResetDate;
	private List<String> roles;
	
	public Mainbody getMainbody() {
		return mainbody;
	}

	public void setMainbody(Mainbody mainbody) {
		this.mainbody = mainbody;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getLastPasswordResetDate() {
		return lastPasswordResetDate;
	}

	public void setLastPasswordResetDate(Date lastPasswordResetDate) {
		this.lastPasswordResetDate = lastPasswordResetDate;
	}

	public List<String> getRoles() {
		return roles;
	}

	public void setRoles(List<String> roles) {
		this.roles = roles;
	}
	
}
